<template>
    <div id="app">
        <!-- <template v-if="!is_pc">
            <keep-alive>
                <router-view v-if="$route.meta.keepAlive" v-wechat-title='$route.meta.title'></router-view>
            </keep-alive>
            <router-view v-if="!$route.meta.keepAlive" v-wechat-title='$route.meta.title'></router-view>
        </template>
        <template v-else>
           请用手机打开
        </template> -->
        
        <!--缓存想要缓存的页面，实现后退不刷新-->
        <!--加上v-if的判断，可以自定义想要缓存的组件，自定义在router里面-->
        <keep-alive>
            <router-view v-if="$route.meta.keepAlive" v-wechat-title='$route.meta.title'></router-view>
        </keep-alive>
        <router-view v-if="!$route.meta.keepAlive" v-wechat-title='$route.meta.title'></router-view>
    </div>
</template>

<script>
export default {
    data(){
        return{
            is_pc:true
        }
    },
    mounted:function(){
        //判断是手机还是pc
        if(navigator.platform.indexOf('Win32')!=-1){
            // console.log("是在电脑");
            //Toast("是在电脑", 10000);
            this.is_pc=true
            return true;
        }else{
            // console.log("是在手机");
            // Toast("是在手机", 10000);
            this.is_pc=false
            return false;
        }
    }
}
</script>
